home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kjs / object.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  23.8 KB  |  727 lines

  1. // -*- c-basic-offset: 2 -*-
  2. /*
  3.  *  This file is part of the KDE libraries
  4.  *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
  5.  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
  6.  *  Copyright (C) 2003 Apple Computer, Inc.
  7.  *
  8.  *  This library is free software; you can redistribute it and/or
  9.  *  modify it under the terms of the GNU Library General Public
  10.  *  License as published by the Free Software Foundation; either
  11.  *  version 2 of the License, or (at your option) any later version.
  12.  *
  13.  *  This library is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  *  Library General Public License for more details.
  17.  *
  18.  *  You should have received a copy of the GNU Library General Public License
  19.  *  along with this library; see the file COPYING.LIB.  If not, write to
  20.  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21.  *  Boston, MA 02110-1301, USA.
  22.  *
  23.  */
  24.  
  25.  
  26. #ifndef _KJS_OBJECT_H_
  27. #define _KJS_OBJECT_H_
  28.  
  29. // Objects
  30.  
  31. #include "value.h"
  32. #include "types.h"
  33. #include "reference_list.h"
  34. #include "identifier.h"
  35. #include "property_map.h"
  36. #include "scope_chain.h"
  37.  
  38. namespace KJS {
  39.  
  40.   class ObjectImpPrivate;
  41.   class PropertyMap;
  42.   class HashTable;
  43.   struct HashEntry;
  44.   class ListImp;
  45.  
  46.   /** Attributes (only applicable to the Object type).
  47.   *   See ECMA 262-3 8.6.1
  48.   */ 
  49.   enum Attribute { None       = 0,
  50.                    ReadOnly   = 1 << 1, ///< property can be only read, not written
  51.                    DontEnum   = 1 << 2, ///< property doesn't appear in (for .. in ..)
  52.                    DontDelete = 1 << 3, ///< property can't be deleted
  53.                    Internal   = 1 << 4, ///< an internal property, set to by pass checks
  54.                    Function   = 1 << 5 }; ///< property is a function - only used by static hashtables
  55.  
  56.   /**
  57.    * Class Information
  58.    */
  59.   struct ClassInfo {
  60.     /**
  61.      * A string denoting the class name. Example: "Window".
  62.      */
  63.     const char* className;
  64.     /**
  65.      * Pointer to the class information of the base class.
  66.      * 0L if there is none.
  67.      */
  68.     const ClassInfo *parentClass;
  69.     /**
  70.      * Static hash-table of properties.
  71.      */
  72.     const HashTable *propHashTable;
  73.     /**
  74.      * Reserved for future extension.
  75.      */
  76.     void *dummy;
  77.   };
  78.  
  79.   /**
  80.    * Represents an Object. This is a wrapper for ObjectImp
  81.    */
  82.   class KJS_EXPORT Object : public Value {
  83.   public:
  84.     Object() { }
  85.     explicit Object(ObjectImp *v);
  86.  
  87.     ObjectImp *imp() const;
  88.  
  89.     const ClassInfo *classInfo() const;
  90.     bool inherits(const ClassInfo *cinfo) const;
  91.  
  92.     /**
  93.      * Converts a Value into an Object. If the value's type is not ObjectType,
  94.      * a null object will be returned (i.e. one with it's internal pointer set
  95.      * to 0). If you do not know for sure whether the value is of type
  96.      * ObjectType, you should check the isValid() methods afterwards before
  97.      * calling any methods on the Object.
  98.      *
  99.      * @return The value converted to an object
  100.      */
  101.     static Object dynamicCast(const Value &v);
  102.  
  103.     /**
  104.      * Returns the prototype of this object. Note that this is not the same as
  105.      * the "prototype" property.
  106.      *
  107.      * See ECMA 8.6.2
  108.      *
  109.      * @return The object's prototype
  110.      */
  111.     Value prototype() const;
  112.  
  113.     /**
  114.      * Returns the class name of the object
  115.      *
  116.      * See ECMA 8.6.2
  117.      *
  118.      * @return The object's class name
  119.      */
  120.     UString className() const;
  121.  
  122.     /**
  123.      * Retrieves the specified property from the object. If neither the object
  124.      * or any other object in it's prototype chain have the property, this
  125.      * function will return Undefined.
  126.      *
  127.      * See ECMA 8.6.2.1
  128.      *
  129.      * @param exec The current execution state
  130.      * @param propertyName The name of the property to retrieve
  131.      *
  132.      * @return The specified property, or Undefined
  133.      */
  134.     Value get(ExecState *exec, const Identifier &propertyName) const;
  135.     Value get(ExecState *exec, unsigned propertyName) const;
  136.  
  137.     /**
  138.      * Sets the specified property.
  139.      *
  140.      * See ECMA 8.6.2.2
  141.      *
  142.      * @param exec The current execution state
  143.      * @param propertyName The name of the property to set
  144.      * @param value The value to set
  145.      * @param attr The Attribute value for the property
  146.      */
  147.     void put(ExecState *exec, const Identifier &propertyName,
  148.          const Value &value, int attr = None);
  149.     void put(ExecState *exec, unsigned propertyName,
  150.          const Value &value, int attr = None);
  151.  
  152.     /**
  153.      * Used to check whether or not a particular property is allowed to be set
  154.      * on an object
  155.      *
  156.      * See ECMA 8.6.2.3
  157.      *
  158.      * @param exec The current execution state
  159.      * @param propertyName The name of the property
  160.      * @return true if the property can be set, otherwise false
  161.      */
  162.     bool canPut(ExecState *exec, const Identifier &propertyName) const;
  163.  
  164.     /**
  165.      * Checks to see whether the object (or any object in it's prototype chain)
  166.      * has a property with the specified name.
  167.      *
  168.      * See ECMA 8.6.2.4
  169.      *
  170.      * @param exec The current execution state
  171.      * @param propertyName The name of the property to check for
  172.      * @return true if the object has the property, otherwise false
  173.      */
  174.     bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
  175.     bool hasProperty(ExecState *exec, unsigned propertyName) const;
  176.  
  177.     /**
  178.      * Removes the specified property from the object.
  179.      *
  180.      * See ECMA 8.6.2.5
  181.      *
  182.      * @param exec The current execution state
  183.      * @param propertyName The name of the property to delete
  184.      * @return true if the property was successfully deleted or did not
  185.      * exist on the object. false if deleting the specified property is not
  186.      * allowed.
  187.      */
  188.     bool deleteProperty(ExecState *exec, const Identifier &propertyName);
  189.     bool deleteProperty(ExecState *exec, unsigned propertyName);
  190.  
  191.     /**
  192.      * Converts the object into a primitive value. The value return may differ
  193.      * depending on the supplied hint
  194.      *
  195.      * See ECMA 8.6.2.6
  196.      *
  197.      * @param exec The current execution state
  198.      * @param hint The desired primitive type to convert to
  199.      * @return A primitive value converted from the objetc. Note that the
  200.      * type of primitive value returned may not be the same as the requested
  201.      * hint.
  202.      */
  203.     Value defaultValue(ExecState *exec, Type hint) const;
  204.  
  205.     /**
  206.      * Whether or not the object implements the construct() method. If this
  207.      * returns false you should not call the construct() method on this
  208.      * object (typically, an assertion will fail to indicate this).
  209.      *
  210.      * @return true if this object implements the construct() method, otherwise
  211.      * false
  212.      */
  213.     bool implementsConstruct() const;
  214.  
  215.     /**
  216.      * Creates a new object based on this object. Typically this means the
  217.      * following:
  218.      * 1. A new object is created
  219.      * 2. The prototype of the new object is set to the value of this object's
  220.      *    "prototype" property
  221.      * 3. The call() method of this object is called, with the new object
  222.      *    passed as the this value
  223.      * 4. The new object is returned
  224.      *
  225.      * In some cases, Host objects may differ from these semantics, although
  226.      * this is discouraged.
  227.      *
  228.      * If an error occurs during construction, the execution state's exception
  229.      * will be set. This can be tested for with ExecState::hadException().
  230.      * Under some circumstances, the exception object may also be returned.
  231.      *
  232.      * Note: This function should not be called if implementsConstruct() returns
  233.      * false, in which case it will result in an assertion failure.
  234.      *
  235.      * @param exec The current execution state
  236.      * @param args The arguments to be passed to call() once the new object has
  237.      * been created
  238.      * @return The newly created & initialized object
  239.      */
  240.     Object construct(ExecState *exec, const List &args);
  241.  
  242.     /**
  243.      * Whether or not the object implements the call() method. If this returns
  244.      * false you should not call the call() method on this object (typically,
  245.      * an assertion will fail to indicate this).
  246.      *
  247.      * @return true if this object implements the call() method, otherwise
  248.      * false
  249.      */
  250.     bool implementsCall() const;
  251.  
  252.  
  253.     /**
  254.      * Calls this object as if it is a function.
  255.      *
  256.      * Note: This function should not be called if implementsCall() returns
  257.      * false, in which case it will result in an assertion failure.
  258.      *
  259.      * See ECMA 8.6.2.3
  260.      *
  261.      * @param exec The current execution state
  262.      * @param thisObj The obj to be used as "this" within function execution.
  263.      * Note that in most cases this will be different from the C++ "this"
  264.      * object. For example, if the ECMAScript code "window.location.toString()"
  265.      * is executed, call() will be invoked on the C++ object which implements
  266.      * the toString method, with the thisObj being window.location
  267.      * @param args List of arguments to be passed to the function
  268.      * @return The return value from the function
  269.      */
  270.     Value call(ExecState *exec, Object &thisObj, const List &args);
  271.  
  272.     /**
  273.      * Whether or not the object implements the hasInstance() method. If this
  274.      * returns false you should not call the hasInstance() method on this
  275.      * object (typically, an assertion will fail to indicate this).
  276.      *
  277.      * @return true if this object implements the hasInstance() method,
  278.      * otherwise false
  279.      */
  280.     bool implementsHasInstance() const;
  281.  
  282.     /**
  283.      * Checks whether value delegates behavior to this object. Used by the
  284.      * instanceof operator.
  285.      *
  286.      * @param exec The current execution state
  287.      * @param value The value to check
  288.      * @return true if value delegates behavior to this object, otherwise
  289.      * false
  290.      */
  291.     Boolean hasInstance(ExecState *exec, const Value &value);
  292.  
  293.     /**
  294.      * Returns the scope of this object. This is used when execution declared
  295.      * functions - the execution context for the function is initialized with
  296.      * extra object in it's scope. An example of this is functions declared
  297.      * inside other functions:
  298.      *
  299.      * \code
  300.      * function f() {
  301.      *
  302.      *   function b() {
  303.      *     return prototype;
  304.      *   }
  305.      *
  306.      *   var x = 4;
  307.      *   // do some stuff
  308.      * }
  309.      * f.prototype = new String();
  310.      * \endcode
  311.      *
  312.      * When the function f.b is executed, its scope will include properties of
  313.      * f. So in the example above the return value of f.b() would be the new
  314.      * String object that was assigned to f.prototype.
  315.      *
  316.      * @return The function's scope
  317.      */
  318.     const ScopeChain &scope() const;
  319.     void setScope(const ScopeChain &s);
  320.  
  321.     /**
  322.      * Returns a List of References to all the properties of the object. Used
  323.      * in "for x in y" statements. The list is created new, so it can be freely
  324.      * modified without affecting the object's properties. It should be deleted
  325.      * by the caller.
  326.      *
  327.      * Subclasses can override this method in ObjectImpl to provide the
  328.      * appearance of
  329.      * having extra properties other than those set specifically with put().
  330.      *
  331.      * @param exec The current execution state
  332.      * @param recursive Whether or not properties in the object's prototype
  333.      * chain should be
  334.      * included in the list.
  335.      * @return A List of References to properties of the object.
  336.      **/
  337.     ReferenceList propList(ExecState *exec, bool recursive = true);
  338.  
  339.     /**
  340.      * Returns the internal value of the object. This is used for objects such
  341.      * as String and Boolean which are wrappers for native types. The interal
  342.      * value is the actual value represented by the wrapper objects.
  343.      *
  344.      * @see ECMA 8.6.2
  345.      * @return The internal value of the object
  346.      */
  347.     Value internalValue() const;
  348.  
  349.     /**
  350.      * Sets the internal value of the object
  351.      *
  352.      * @see internalValue()
  353.      *
  354.      * @param v The new internal value
  355.      */
  356.     void setInternalValue(const Value &v);
  357.   };
  358.  
  359.   inline Object Value::toObject(ExecState *exec) const { return rep->dispatchToObject(exec); }
  360.  
  361.   class KJS_EXPORT ObjectImp : public ValueImp {
  362.     friend class ObjectProtoFuncImp;
  363.   public:
  364.     /**
  365.      * Creates a new ObjectImp with the specified prototype
  366.      *
  367.      * @param proto The prototype
  368.      */
  369.     ObjectImp(const Object &proto);
  370.     ObjectImp(ObjectImp *proto);
  371.  
  372.     /**
  373.      * Creates a new ObjectImp with a prototype of Null()
  374.      * (that is, the ECMAScript "null" value, not a null Object).
  375.      *
  376.      */
  377.     ObjectImp();
  378.  
  379.     virtual ~ObjectImp();
  380.  
  381.     virtual void mark();
  382.  
  383.     Type type() const;
  384.  
  385.     /**
  386.      * A pointer to a ClassInfo struct for this class. This provides a basic
  387.      * facility for run-time type information, and can be used to check an
  388.      * object's class an inheritance (see inherits()). This should
  389.      * always return a statically declared pointer, or 0 to indicate that
  390.      * there is no class information.
  391.      *
  392.      * This is primarily useful if you have application-defined classes that you
  393.      * wish to check against for casting purposes.
  394.      *
  395.      * For example, to specify the class info for classes FooImp and BarImp,
  396.      * where FooImp inherits from BarImp, you would add the following in your
  397.      * class declarations:
  398.      *
  399.      * \code
  400.      *   class BarImp : public ObjectImp {
  401.      *     virtual const ClassInfo *classInfo() const { return &info; }
  402.      *     static const ClassInfo info;
  403.      *     // ...
  404.      *   };
  405.      *
  406.      *   class FooImp : public ObjectImp {
  407.      *     virtual const ClassInfo *classInfo() const { return &info; }
  408.      *     static const ClassInfo info;
  409.      *     // ...
  410.      *   };
  411.      * \endcode
  412.      *
  413.      * And in your source file:
  414.      *
  415.      * \code
  416.      *   const ClassInfo BarImp::info = {0, 0, 0}; // no parent class
  417.      *   const ClassInfo FooImp::info = {&BarImp::info, 0, 0};
  418.      * \endcode
  419.      *
  420.      * @see inherits()
  421.      */
  422.     virtual const ClassInfo *classInfo() const;
  423.  
  424.     /**
  425.      * Checks whether this object inherits from the class with the specified
  426.      * classInfo() pointer. This requires that both this class and the other
  427.      * class return a non-NULL pointer for their classInfo() methods (otherwise
  428.      * it will return false).
  429.      *
  430.      * For example, for two ObjectImp pointers obj1 and obj2, you can check
  431.      * if obj1's class inherits from obj2's class using the following:
  432.      *
  433.      *   if (obj1->inherits(obj2->classInfo())) {
  434.      *     // ...
  435.      *   }
  436.      *
  437.      * If you have a handle to a statically declared ClassInfo, such as in the
  438.      * classInfo() example, you can check for inheritance without needing
  439.      * an instance of the other class:
  440.      *
  441.      *   if (obj1->inherits(FooImp::info)) {
  442.      *     // ...
  443.      *   }
  444.      *
  445.      * @param cinfo The ClassInfo pointer for the class you want to check
  446.      * inheritance against.
  447.      * @return true if this object's class inherits from class with the
  448.      * ClassInfo pointer specified in cinfo
  449.      */
  450.     bool inherits(const ClassInfo *cinfo) const;
  451.  
  452.     // internal properties (ECMA 262-3 8.6.2)
  453.  
  454.     /**
  455.      * Implementation of the [[Prototype]] internal property (implemented by
  456.      * all Objects)
  457.      *
  458.      * @see Object::prototype()
  459.      */
  460.     Value prototype() const;
  461.     void setPrototype(const Value &proto);
  462.  
  463.     /**
  464.      * Implementation of the [[Class]] internal property (implemented by all
  465.      * Objects)
  466.      *
  467.      * The default implementation uses classInfo().
  468.      * You should either implement classInfo(), or
  469.      * if you simply need a classname, you can reimplement className()
  470.      * instead.
  471.      *
  472.      * @see Object::className()
  473.      */
  474.     virtual UString className() const;
  475.  
  476.     /**
  477.      * Implementation of the [[Get]] internal property (implemented by all
  478.      * Objects)
  479.      *
  480.      * @see Object::get()
  481.      */
  482.     // [[Get]] - must be implemented by all Objects
  483.     virtual Value get(ExecState *exec, const Identifier &propertyName) const;
  484.     virtual Value getPropertyByIndex(ExecState *exec,
  485.                      unsigned propertyName) const;
  486.  
  487.     /**
  488.      * Implementation of the [[Put]] internal property (implemented by all
  489.      * Objects)
  490.      *
  491.      * @see Object::put()
  492.      */
  493.     virtual void put(ExecState *exec, const Identifier &propertyName,
  494.              const Value &value, int attr = None);
  495.     virtual void putPropertyByIndex(ExecState *exec, unsigned propertyName,
  496.                     const Value &value, int attr = None);
  497.  
  498.     /**
  499.      * Implementation of the [[CanPut]] internal property (implemented by all
  500.      * Objects)
  501.      *
  502.      * @see Object::canPut()
  503.      */
  504.     virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
  505.  
  506.     /**
  507.      * Implementation of the [[HasProperty]] internal property (implemented by
  508.      * all Objects)
  509.      *
  510.      * @see Object::hasProperty()
  511.      */
  512.     virtual bool hasProperty(ExecState *exec,
  513.                  const Identifier &propertyName) const;
  514.     virtual bool hasPropertyByIndex(ExecState *exec, unsigned propertyName) const;
  515.  
  516.     /**
  517.      * Implementation of the [[Delete]] internal property (implemented by all
  518.      * Objects)
  519.      *
  520.      * @see Object::deleteProperty()
  521.      */
  522.     virtual bool deleteProperty(ExecState *exec,
  523.                 const Identifier &propertyName);
  524.     virtual bool deletePropertyByIndex(ExecState *exec, unsigned propertyName);
  525.  
  526.     /**
  527.      * Remove all properties from this object.
  528.      * This doesn't take DontDelete into account, and isn't in the ECMA spec.
  529.      * It's simply a quick way to remove everything before destroying.
  530.      */
  531.     void deleteAllProperties(ExecState *);
  532.  
  533.     /**
  534.      * Implementation of the [[DefaultValue]] internal property (implemented by
  535.      * all Objects)
  536.      *
  537.      * @see Object::defaultValue()
  538.      */
  539.     virtual Value defaultValue(ExecState *exec, Type hint) const;
  540.  
  541.     virtual bool implementsConstruct() const;
  542.     /**
  543.      * Implementation of the [[Construct]] internal property
  544.      *
  545.      * @see Object::construct()
  546.      */
  547.     virtual Object construct(ExecState *exec, const List &args);
  548.  
  549.     virtual bool implementsCall() const;
  550.     /**
  551.      * Implementation of the [[Call]] internal property
  552.      *
  553.      * @see Object::call()
  554.      */
  555.     virtual Value call(ExecState *exec, Object &thisObj,
  556.                        const List &args);
  557.  
  558.     virtual bool implementsHasInstance() const;
  559.     /**
  560.      * Implementation of the [[HasInstance]] internal property
  561.      *
  562.      * @see Object::hasInstance()
  563.      */
  564.     virtual Boolean hasInstance(ExecState *exec, const Value &value);
  565.  
  566.     /**
  567.      * Implementation of the [[Scope]] internal property
  568.      *
  569.      * @see Object::scope()
  570.      */
  571.     const ScopeChain &scope() const { return _scope; }
  572.     void setScope(const ScopeChain &s) { _scope = s; }
  573.  
  574.     virtual ReferenceList propList(ExecState *exec, bool recursive = true);
  575.  
  576.     Value internalValue() const;
  577.     void setInternalValue(const Value &v);
  578.     void setInternalValue(ValueImp *v);
  579.  
  580.     Value toPrimitive(ExecState *exec,
  581.                       Type preferredType = UnspecifiedType) const;
  582.     bool toBoolean(ExecState *exec) const;
  583.     double toNumber(ExecState *exec) const;
  584.     UString toString(ExecState *exec) const;
  585.     Object toObject(ExecState *exec) const;
  586.  
  587.     // This get method only looks at the property map.
  588.     // A bit like hasProperty(recursive=false), this doesn't go to the prototype.
  589.     // This is used e.g. by lookupOrCreateFunction (to cache a function, we don't want
  590.     // to look up in the prototype, it might already exist there)
  591.     ValueImp *getDirect(const Identifier& propertyName) const
  592.         { return _prop.get(propertyName); }
  593.     void putDirect(const Identifier &propertyName, ValueImp *value, int attr = 0);
  594.     void putDirect(const Identifier &propertyName, int value, int attr = 0);
  595.  
  596.     /**
  597.      * Sets the name of the function, if this is an InternalFunctionImp object.
  598.      * (calling InternalFunctionImp::setName)
  599.      */
  600.     void setFunctionName(const Identifier &propertyName);
  601.  
  602.   protected:
  603.     PropertyMap _prop;
  604.   private:
  605.     const HashEntry* findPropertyHashEntry( const Identifier& propertyName ) const;
  606.     ObjectImpPrivate *_od;
  607.     ValueImp *_proto;
  608.     ValueImp *_internalValue;
  609.     ScopeChain _scope;
  610.   };
  611.  
  612.   /**
  613.    * Types of Native Errors available. For custom errors, GeneralError
  614.    * should be used.
  615.    */
  616.   enum ErrorType { GeneralError   = 0,
  617.                    EvalError      = 1,
  618.                    RangeError     = 2,
  619.                    ReferenceError = 3,
  620.                    SyntaxError    = 4,
  621.                    TypeError      = 5,
  622.                    URIError       = 6};
  623.  
  624.   /**
  625.    * @short Factory methods for error objects.
  626.    */
  627.   class KJS_EXPORT Error {
  628.   public:
  629.     /**
  630.      * Factory method for error objects.
  631.      *
  632.      * @param exec The current execution state
  633.      * @param errtype Type of error.
  634.      * @param message Optional error message.
  635.      * @param lineno Optional line number.
  636.      * @param sourceId Optional source id.
  637.      */
  638.     static Object create(ExecState *exec, ErrorType errtype = GeneralError,
  639.                          const char *message = 0, int lineno = -1,
  640.                          int sourceId = -1);
  641.  
  642.     /**
  643.      * Array of error names corresponding to ErrorType
  644.      */
  645.     static const char * const * const errorNames;
  646.   };
  647.  
  648.   inline Object::Object(ObjectImp *v) : Value(v) { }
  649.  
  650.   inline ObjectImp *Object::imp() const { return static_cast<ObjectImp*>(rep); }
  651.  
  652.   inline const ClassInfo *Object::classInfo() const
  653.     { return imp()->classInfo(); }
  654.  
  655.   inline bool Object::inherits(const ClassInfo *cinfo) const
  656.     { return imp()->inherits(cinfo); }
  657.  
  658.   inline Value Object::prototype() const
  659.     { return Value(imp()->prototype()); }
  660.  
  661.   inline UString Object::className() const
  662.     { return imp()->className(); }
  663.  
  664.   inline Value Object::get(ExecState *exec, const Identifier &propertyName) const
  665.     { return imp()->get(exec,propertyName); }
  666.  
  667.   inline Value Object::get(ExecState *exec, unsigned propertyName) const
  668.     { return imp()->getPropertyByIndex(exec, propertyName); }
  669.  
  670.   inline void Object::put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr)
  671.     { imp()->put(exec,propertyName,value,attr); }
  672.  
  673.   inline void Object::put(ExecState *exec, unsigned propertyName, const Value &value, int attr)
  674.     { imp()->putPropertyByIndex(exec, propertyName, value, attr); }
  675.  
  676.   inline bool Object::canPut(ExecState *exec, const Identifier &propertyName) const
  677.     { return imp()->canPut(exec,propertyName); }
  678.  
  679.   inline bool Object::hasProperty(ExecState *exec, const Identifier &propertyName) const
  680.     { return imp()->hasProperty(exec, propertyName); }
  681.  
  682.   inline bool Object::hasProperty(ExecState *exec, unsigned propertyName) const
  683.     { return imp()->hasPropertyByIndex(exec, propertyName); }
  684.  
  685.   inline bool Object::deleteProperty(ExecState *exec, const Identifier &propertyName)
  686.     { return imp()->deleteProperty(exec,propertyName); }
  687.  
  688.   inline bool Object::deleteProperty(ExecState *exec, unsigned propertyName)
  689.     { return imp()->deletePropertyByIndex(exec, propertyName); }
  690.  
  691.   inline Value Object::defaultValue(ExecState *exec, Type hint) const
  692.     { return imp()->defaultValue(exec,hint); }
  693.  
  694.   inline bool Object::implementsConstruct() const
  695.     { return imp()->implementsConstruct(); }
  696.  
  697.   inline Object Object::construct(ExecState *exec, const List &args)
  698.     { return imp()->construct(exec,args); }
  699.  
  700.   inline bool Object::implementsCall() const
  701.     { return imp()->implementsCall(); }
  702.  
  703.   inline bool Object::implementsHasInstance() const
  704.     { return imp()->implementsHasInstance(); }
  705.  
  706.   inline Boolean Object::hasInstance(ExecState *exec, const Value &value)
  707.     { return imp()->hasInstance(exec,value); }
  708.  
  709.   inline const ScopeChain &Object::scope() const
  710.     { return imp()->scope(); }
  711.  
  712.   inline void Object::setScope(const ScopeChain &s)
  713.     { imp()->setScope(s); }
  714.  
  715.   inline ReferenceList Object::propList(ExecState *exec, bool recursive)
  716.     { return imp()->propList(exec,recursive); }
  717.  
  718.   inline Value Object::internalValue() const
  719.     { return imp()->internalValue(); }
  720.  
  721.   inline void Object::setInternalValue(const Value &v)
  722.     { imp()->setInternalValue(v); }
  723.  
  724. } // namespace
  725.  
  726. #endif // _KJS_OBJECT_H_
  727.